package com.sjyp.cms.controller.admin;

import com.jfinal.core.Controller;

public class BaseController extends Controller {
    protected void initPage() {
        //页面公共分页
        int pageNumber = this.getParaToInt("pageNumber", 1);
        int pageSize = this.getParaToInt("pageSize", 10);
        this.setAttr("pageNumber",pageNumber).setAttr("pageSize",pageSize);
    }

    /**
     * 设置成功失败页面  title  和 跳转 url
     * 示例："栏目"   column
     * @param title
     * @param currentModel
     */
    protected void setCommon(String title,String currentModel,boolean isSucess) {
        this.setAttr("title", title);
        this.setAttr("currentModel", currentModel);
        if (isSucess) {
            this.render("common_save_sucess.html");
        } else {
            this.render("common_save_fail.html");
        }
    }
}
